package zigzag.designpattern.iterator;

public class IteratorClient {
	public static void main(String[] args) {
	       DvdList dvdMovies = new DvdList();
	       dvdMovies.append("Movie 1");
	       dvdMovies.append("Movie 2");
	       dvdMovies.append("Movie 3");
	       dvdMovies.append("Movie 4");
	       dvdMovies.append("Movie 5");
	       dvdMovies.append("Movie 6");

	       DvdListIterator dvdMoviesIterator = 
	         dvdMovies.createIterator();
	       while (!dvdMoviesIterator.isDone()) {
	           System.out.println(dvdMoviesIterator.currentItem());
	           dvdMoviesIterator.next();  
	       }
	       
	       dvdMovies.delete("Movie 4");
	       
	       System.out.println(" ");   
	       dvdMoviesIterator.first();       
	       while (!dvdMoviesIterator.isDone()) {
	           System.out.println(dvdMoviesIterator.currentItem());
	           dvdMoviesIterator.next();  
	       }       
	   }

}
